package org.adorsys.aderp.po.domain;

import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.ManyToOne;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.entity.RooJpaEntity;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooJpaEntity
public class OrderItem {

    @NotNull
    @Column(name = "orderItemKeyBk", unique = true)
    private String orderItemKey;

    @NotNull
    @ManyToOne
    private PurchaseOrder purchaseOrder;

    @NotNull
    @ManyToOne
    private ProductRef productRef;

    @NotNull
    @Min(0L)
    private BigDecimal qty;

    @Min(0L)
    private BigDecimal priceUnit;

    private String recordOwner;
}
